/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package br.com.menosehmais.framework.persistence;

import javax.persistence.MappedSuperclass;
import org.hibernate.annotations.Type;
import org.joda.time.DateTime;

/**
 *
 * @author Junior JAFJ
 */
@MappedSuperclass
public abstract class MagicCount<DO extends DomainObject> extends DomainObject {
    private DO reference;

    private Long count;

    @Type(type = "org.joda.time.contrib.hibernate.PersistentDateTime")
    private DateTime lastCounterSelfUpdate;

    /*
     * Considerando atualizacao para com a base de dados com data superior
     * a 5 dias
     */
    @Type(type = "org.joda.time.contrib.hibernate.PersistentDateTime")
    private DateTime lastCounterFullUpdate;

    public Long getCount() {
        return count;
    }

    public void setCount(Long count) {
        this.count = count;
    }
    
    public DO getReference() {
        return reference;
    }

    public void setReference(DO reference) {
        this.reference = reference;
    }

    public DateTime getLastCounterFullUpdate() {
        return lastCounterFullUpdate;
    }

    public void setLastCounterFullUpdate(DateTime lastCounterFullUpdate) {
        this.lastCounterFullUpdate = lastCounterFullUpdate;
    }

    public DateTime getLastCounterSelfUpdate() {
        return lastCounterSelfUpdate;
    }

    public void setLastCounterSelfUpdate(DateTime lastCounterSelfUpdate) {
        this.lastCounterSelfUpdate = lastCounterSelfUpdate;
    }    
}
